package FastJosnTest.StudentToJson;

import com.alibaba.fastjson.annotation.JSONField;

public class Students {

    @JSONField(ordinal = 1)
    private long id;
    @JSONField(ordinal = 2)
    private String name;
    @JSONField(ordinal = 3)
    private int age;
    @JSONField(ordinal = 4)
    private String sex;
    @JSONField(ordinal = 5)
    private String className;

    public void set(long id, String name, int age, String sex, String className) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.className = className;
    }

    @Override
    public String toString() {
        return id+"\t"+name+"\t"+age+"\t"+sex+"\t"+className;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }
}
